﻿<Window x:Class="ChangeJournalBrowser.Window1"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:cj="clr-namespace:ManagedChangeJournal;assembly=ManagedChangeJournal"
    Title="Change Journal Browser" ResizeMode="NoResize" SizeToContent="Height" 
        Height="Auto" Width="525" Loaded="Window_Loaded">

  
    <Window.Resources>
          
        <DataTemplate DataType="{x:Type cj:JournalEntry}">
            <Border Margin="2,2,0,0" BorderThickness="0,0,0,1" BorderBrush="Black">
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition/>
                        <ColumnDefinition/>
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition/>
                        <RowDefinition/>
                        <RowDefinition/>
                        <RowDefinition/>
                        <RowDefinition/>
                        <RowDefinition/>
                        <RowDefinition/>
                    </Grid.RowDefinitions>

                    <TextBlock Text="File: " FontWeight="Heavy"/>
                    <TextBlock Grid.Row="1" Text="Reason: " FontWeight="Heavy"/>
                    <TextBlock Grid.Row="2" Text="Source: " FontWeight="Heavy"/>
                    <TextBlock Grid.Row="3" Text="Time: " FontWeight="Heavy"/>
                    <TextBlock Grid.Row="4" Text="USN: " FontWeight="Heavy"/>
                    <TextBlock Grid.Row="5" Text="Ref.#: " FontWeight="Heavy"/>
                    <TextBlock Grid.Row="6" Text="Parent Ref.#: " FontWeight="Heavy"/>

                    <TextBlock Grid.Column="1" Text="{Binding Name}" FontStyle="Italic"/>
                    <TextBlock Grid.Column="1" Grid.Row="1" Text="{Binding Reason}" FontStyle="Italic"/>
                    <TextBlock Grid.Column="1" Grid.Row="2" Text="{Binding Source}" FontStyle="Italic"/>
                    <TextBlock Grid.Column="1" Grid.Row="3" Text="{Binding TimeStamp}" FontStyle="Italic"/>
                    <TextBlock Grid.Column="1" Grid.Row="4" Text="{Binding UniqueSequenceNumber}" FontStyle="Italic"/>
                    <TextBlock Grid.Column="1" Grid.Row="5" Text="{Binding ReferenceNumber}" FontStyle="Italic"/>
                    <TextBlock Grid.Column="1" Grid.Row="6" Text="{Binding ParentReferenceNumber}" FontStyle="Italic"/>
                </Grid>
            </Border>
        </DataTemplate>
        
        <Style TargetType="TextBlock">
            <Setter Property="VerticalAlignment" Value="Center"/>
        </Style>
        
        <Style TargetType="Button">
            <Setter Property="Height" Value="35"/>
            <Setter Property="IsEnabled" Value="False"/> 
        </Style>
        
        <Style TargetType="Expander">
            <Setter Property="Margin" Value="4"/>
            <Setter Property="IsExpanded" Value="True"/>
            <Setter Property="BorderThickness" Value="1,0,1,0"/>
            <Setter Property="BorderBrush" Value="Black"/>            
        </Style>
        
        <Style TargetType="ListView">
            <Setter Property="BorderThickness" Value="0"/>
            <Setter Property="Background" Value="Transparent"/>
            <Setter Property="ItemContainerStyle">
                <Setter.Value>
                    <Style TargetType="ListViewItem">
                        <Setter Property="HorizontalContentAlignment" Value="Stretch" />
                    </Style>
                </Setter.Value>
            </Setter>
        </Style>
        
        <RadialGradientBrush x:Key="BackgroundBrush" GradientOrigin="-0.161,-0.226">
            <RadialGradientBrush.RelativeTransform>
                <TransformGroup>
                    <ScaleTransform CenterX="0.5" CenterY="0.5" ScaleX="1.437" ScaleY="1.682"/>
                    <TranslateTransform X="0.191" Y="0.25"/>
                </TransformGroup>
            </RadialGradientBrush.RelativeTransform>
            <GradientStop Color="#FFFFFFFF" Offset="0.4"/>
            <GradientStop Color="#FFADB8C2" Offset="1"/>
        </RadialGradientBrush>
        
    </Window.Resources>

    <StackPanel Background="{StaticResource BackgroundBrush}">
        
        <Expander Header="Volume Selector">
            <ListView Name="lviewVolumes" SelectionChanged="lviewVolumes_SelectionChanged">
                <ListViewItem Content="Not available until runtime"/>
            </ListView>
        </Expander>

        <Expander Header="Volume Journal Data and Actions">
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="4*"/>
                    <ColumnDefinition Width="2*"/>
                </Grid.ColumnDefinitions>
                
                <!-- JournalData -->
                <Grid Margin="4">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="4*"/>
                        <ColumnDefinition Width="5*"/>
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition/>
                        <RowDefinition/>
                        <RowDefinition/>
                        <RowDefinition/>
                        <RowDefinition/>
                    </Grid.RowDefinitions>

                    <TextBlock Text="Journal ID:" FontWeight="Heavy"/>
                    <TextBlock Text="Lowest Valid USN:" Grid.Row="1" FontWeight="Heavy"/>
                    <TextBlock Text="Maximum USN:" Grid.Row="2" FontWeight="Heavy"/>
                    <TextBlock Text="Maximum Size:" Grid.Row="3" FontWeight="Heavy"/>
                    <TextBlock Text="Allocation Delta:" Grid.Row="4" FontWeight="Heavy"/>

                    <TextBlock Name="textJournalID" Grid.Column="1"/>
                    <TextBlock Name="textLowestValidUSN" Grid.Column="1" Grid.Row="1"/>
                    <TextBlock Name="textMaximumUSN" Grid.Column="1" Grid.Row="2"/>
                    <TextBlock Name="textMaximumSize" Grid.Column="1" Grid.Row="3"/>
                    <TextBlock Name="textAllocationDelta" Grid.Column="1" Grid.Row="4"/>
                </Grid>

                <!-- Journal Actions -->
                <StackPanel Grid.Column="1" Margin="4">
                    <Button Name="btnOpen" Content="Open" Click="btnOpen_Click" />
                    <Button Name="btnClose" Content="Close" Click="btnClose_Click" />
                    <Button Name="btnActivate" Content="Activate" Click="btnActivate_Click" />
                    <Button Name="btnDeactivate" Content="Deactivate" Click="btnDeactivate_Click" />
                </StackPanel>
                
            </Grid>
        </Expander>

        <Expander Header="Volume Journal Entries">
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="4*"/>
                    <ColumnDefinition Width="2*"/>
                </Grid.ColumnDefinitions>

                <ListView Name="lviewEntries" Height="200" MaxHeight="200"/>
                <StackPanel Grid.Column="1" Margin="4">
                    <Button Name="btnNextSet" Content="Next Set" Click="btnNextSet_Click" />
                </StackPanel>
            </Grid>
        </Expander>
        
        <StatusBar Margin="4" Background="Transparent">
            <TextBlock Text="Status:" FontWeight="Heavy"/>
            <TextBlock Name="textStatus" Text="Journal volume not open."/>
        </StatusBar>

    </StackPanel>
</Window>
